package com.dengke.hellospringmvc.dao;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.stereotype.Repository;

@Repository
public class QueryForRowSetReturnSqlRowSetDAO extends JdbcDaoSupport {
	@Autowired
	public QueryForRowSetReturnSqlRowSetDAO(DataSource dataSource) {
		this.setDataSource(dataSource);
	}

	public SqlRowSet queryForRowSet_SqlRowSet() {
		String sql = "select Title,Description,ReleaseDate,Writer from Movie ";
		SqlRowSet rowSet=this.getJdbcTemplate().queryForRowSet(sql);
		return rowSet;
	}
}
